package com.xiaoxi.userserver.domain.vo.user;

import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

/**
 * @ClassName BMSUserDetailVO
 * @Description
 * @Author xiaoxi
 * @Date 2022/7/10 11:22
 * @Version 1.0
 */
@Data
public class BMSUserDetailVO implements Serializable {

    private Long id;
    private Long userId;
    private String username;
    private List<Long> roles;
    private String name;
    private String telNumber;
    private String email;
    private String headImg;
    private Boolean sex;
    private String introduce;
    private LocalDateTime lastLoginTime;
    private Long version;
    private String remark;
    private LocalDateTime createTime;
    private LocalDateTime modifyTime;

    private Boolean enabled;             // 启用
    private Boolean accountNonLocked;   // 锁定

    private Boolean modifyPassword;     // 编辑用户 - 是否修改密码
    private BMSUserPasswordChangeVO bmsUserPasswordChangeVO;


    @Override
    public String toString() {
        String sexName = "";
        if(Objects.nonNull(sex)) {
            sexName = sex ? "男" : "女";
        }
        String enableMessage = enabled ? "启用" : "禁用";
        String accountNonLockedName = accountNonLocked ? "锁定" : "未锁定";

        return id + "☆" + name + "☆" + telNumber + "☆" + email + "☆" + headImg + "☆" + sexName + "☆" + introduce + "☆" + lastLoginTime + "☆" + version
                + "☆" + createTime  + "☆" + modifyTime + "☆" + remark + "☆" + enableMessage + "☆" + accountNonLockedName;
    }

}
